package com.qire.other.share;

import java.util.HashMap;

import cn.sharesdk.framework.Platform;
import cn.sharesdk.framework.Platform.ShareParams;
import cn.sharesdk.framework.ShareSDK;
import cn.sharesdk.tencent.qzone.QZone;

/**
 * QQ空间分享
 */
public class QZoneShareAction extends ShareActionImpl {
	
	@Override
	protected ShareParams createShareParams(ShareParams shareParams, HashMap<String, Object> shareMap) {

		if((int) shareMap.get("shareType") == Platform.SHARE_WEBPAGE) {
			//带下面两条参数是图文消息，不带则是发表说说
			fillShareParams(shareParams, shareMap, "title");
			fillShareParams(shareParams, shareMap, "titleUrl");
		}

		fillShareParams(shareParams, shareMap, "text");
		fillShareParams(shareParams, shareMap, "imageUrl");
		fillShareParams(shareParams, shareMap, "site");
		fillShareParams(shareParams, shareMap, "siteUrl");
		
		return shareParams;
	}

	@Override
	protected Platform createPlatform() {
		return ShareSDK.getPlatform(QZone.NAME);
	}

}
